import os
import sys

#dtc ux00_zsbl.dts -o ux00_zsbl.dtb -O dtb
cmds = []
U_BOOT_PATH="/home/lingkong/SiFive-OE/riscv-sifive/build/tmp-glibc/work/freedom_u540-oe-linux/u-boot/1_2019.07-r0"
GIT_PATH="/home/lingkong/git/configs/haps"

dest = '%s/build/arch/riscv/dts/' % U_BOOT_PATH
cmd = 'cp %s/ux00_zsbl %s' % (GIT_PATH, dest)
cmds.append(cmd)

dest = '%s/build/.config' % U_BOOT_PATH
cmd = 'cp %s/config %s' % (GIT_PATH, dest)
cmds.append(cmd)

dest = '%s/git/drivers/serial/serial_sifive.c' % U_BOOT_PATH
cmd = 'cp %s/serial_sifive.c %s' % (GIT_PATH, dest)
cmds.append(cmd)

#cp ux00_zsbl.dtb   f
#cp config          $(U_BOOT_PATH)/build/.config
#cp serial_sifive.c $(U_BOOT_PATH)/git/drivers/serial/serial_sifive.c

for cmd in cmds:
    print(cmd)
    #os.system(cmd)
